<?php


namespace app\admin\validates;


use think\Validate;

class QuestionValidate extends Validate
{
    /**
     * 验证规则
     * @var array
     */
    protected $rule = [
        'id' => 'require|number',
        'name' => 'chsDash|max:30',
        'special_id' => 'require|number',
        'desc' => 'chsDash',
        'img' => 'require',
        'sort' => 'number',
    ];

    /**
     * 验证字段描述
     * @var string[]
     */
    protected $field = [
        'id' => 'ID',
        'name' => '练习名称',
        'desc' => '简介',
        'img' => '封面图片',
        'special_id'=>'专业',
    ];

    /**
     * 验证场景
     * @var array
     */
    protected $scene = [
        'add' => ['name', 'special_id','desc','sort'],
        'edit' => ['id', 'name', 'special_id','sort'],
        'del' => ['id'],
        'details' => ['id']
    ];
}